<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', 'home\IndexController@index');
Route::get('hello',function(){
	return view('index');
});
// Route::get('article/index', 'IndexController@index');
// Route::get('article/create', 'IndexController@create');
// Route::post('article/store', 'IndexController@store');
Route::prefix('article')->group(function () {
    Route::get('index', 'IndexController@index');
    Route::get('create', 'IndexController@create');
    Route::post('store', 'IndexController@store');
    Route::get('edit/{id}/{name}','IndexController@edit');
});
//登录路由
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
//后台路由
Route::prefix('admin')->namespace('Admin')->middleware(['auth'])->group(function(){
	Route::get('index','ArticleController@index');
	Route::get('create','ArticleController@create');
	Route::get('edit','ArticleController@edit');
	Route::get('base_info','ArticleController@base_info');
	//退出登录
	Route::get('logout','ArticleController@logout');
	//首页轮播
	Route::prefix('banner')->group(function(){
		Route::get('base_banner','BannerController@base_banner');
		Route::any('base_banner_add','BannerController@base_banner_add');
		Route::get('base_banner_upd/{id}','BannerController@base_banner_upd');
		Route::post('update','BannerController@update');
		Route::get('delete/{id}','BannerController@delete');
	});
	//吉祥物发布
	Route::prefix('goods')->group(function(){
	    //吉祥物添加
		Route::any('goods_list_add','GoodsController@goods_list_add');
		//吉祥物列表
		Route::get('goods_list','GoodsController@goods_list');
		//吉祥物修改
		Route::get('goods_upd/{id}','GoodsController@goods_upd');
		//吉祥物修改
		Route::post('update','GoodsController@update');
		//吉祥物删除
		Route::get('delete/{id}','GoodsController@delete');
	});
	//专家
    Route::prefix('expert')->group(function (){
        //添加
        Route::any('expert_add','ExpertController@expert_add');
        //查看
        Route::get('expert_list','ExpertController@expert_list');
        //修改
        Route::get('expert_upd/{id}','ExpertController@expert_upd');
        Route::any('expert_update','ExpertController@expert_update');
        //删除
        Route::get('delete/{id}','ExpertController@delete');
    });
    //老师
    Route::prefix('teach')->group(function(){
        Route::any('teach_add','TeachController@teach_add');
        Route::get('teach_list','TeachController@teach_list');
        Route::get('teach_upd/{id}','TeachController@teach_upd');
        Route::any('teach_update','TeachController@teach_update');
        Route::get('delete/{id}','TeachController@delete');
    });
    //运程
    Route::prefix('yun')->group(function (){
        Route::any('yun_add','YunController@yun_add');
        Route::get('yun_list','YunController@yun_list');
        Route::get('yun_upd/{id}','YunController@yun_upd');
        Route::any('update','YunController@update');
        Route::get('delete/{id}','YunController@delete');
    });
    //公司业务
    Route::prefix('buss')->group(function(){
       Route::any('business_add','BussController@business_add');
       Route::get('business_list','BussController@business_list');
       Route::get('business_upd/{id}','BussController@business_upd');
       Route::any('update','BussController@update');
       Route::get('delete/{id}','BussController@delete');
    });
    //本周凶吉
    Route::prefix('week')->group(function (){
       Route::any('week_add','WeekController@week_add');
       Route::get('week_list','WeekController@week_list');
       Route::get('week_upd/{id}','WeekController@week_upd');
       Route::any('update','WeekController@update');
       Route::get('delete/{id}','WeekController@delete');
    });
});
//搜索
Route::any('search','home\ExpertController@search');
//前台路由
Route::prefix('home')->namespace('home')->group(function(){
    //关于我们
	Route::get('contact','IndexController@contact');
	Route::get('about','IndexController@about');
	Route::get('news','IndexController@news');
	Route::get('news_details/{id}','IndexController@news_details');
	Route::get('summary','IndexController@summary');
	//team页面
    Route::get('team','IndexController@team');
    Route::get('team_details/{id}','IndexController@team_details');
    Route::any('leaving','IndexController@leaving');
    //本月运程
    Route::get('month_lucky','IndexController@month_lucky');
    //本周运程
    Route::get('week','IndexController@week');
	//首页
	Route::prefix('index')->group(function(){
	   Route::get('index','IndexController@index');
    });
	//吉祥物
    Route::prefix('lucky')->group(function(){
       Route::get('lucky/{id?}','LuckyController@lucky');
       Route::get('lucky_list/{id}','LuckyController@lucky_list');
    });
    //专家
    Route::prefix('expert')->group(function(){
        Route::get('expert_list',['as'=>'expert_li','uses'=>'ExpertController@expert_list']);
        Route::get('expert_details/{id}','ExpertController@expert_details');
        Route::get('business','ExpertController@business');
        Route::get('business_details/{id}','ExpertController@business_details');
    });
});
